

#ifndef CardDefine_h__
#define CardDefine_h__
#include <stdint.h>
#include "Contract.h"

#define CardTypeMask(type)	(1u << (type))

// typedef enum {
// 	Card_T_PiccA,
// 	Card_T_PiccB,
// 	Card_T_Mifare,
// 	Card_T_Max,
// }CardType;

typedef enum 
{
	Card_T_CpuA,
	Card_T_CpuB,
	Card_T_CpuDummy,
	Card_T_CpuMax,
}CardType_CPU_T;

typedef enum
{
	Card_T_MemBase = 8,
	Card_T_Mifare = Card_T_MemBase,
	Card_T_MemMax,
}CardType_Mem_T;


enum {
	Card_S_Idle,
	Card_S_Deactivate,
	Card_S_Activate,
	Card_S_Setup,
};

enum {
	PICC_Op_Activate,
	PICC_Op_Wakeup,
	PICC_Op_Request,
};

enum {
	Card_Ctrl_MFAuth,
	Card_Ctrl_MFRead,
	Card_Ctrl_MFWrite,
	Card_Ctrl_MFInc,
	Card_Ctrl_MFDec,
	Card_Ctrl_MFRestore,
	Card_Ctrl_Transfer,
	Card_Ctrl_SetValue,
};

typedef struct CardTag Card_T;
typedef struct CpuCardOpsTag CpuCardOps_T;
typedef struct CardFactoryTag CardFactory_T;
typedef struct CpuCardTag CpuCard_T;
typedef struct MemCardTag MemCard_T;
typedef struct MifareInfoTag MifareInfo_T;
typedef struct MemCardOpsTag MemCardOps_T;

#endif // CardDefine_h__
